using System.Configuration;
using System.Data;
using System.Data.SqlClient;

namespace SalesAndStoreApp.DAL.Gateway
{
    public class DbGateway
    {
        protected SqlConnection Connection;
        protected SqlCommand Command = new SqlCommand();
        public DbGateway()
        {
            Connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SalesStoreConnectionString"].ConnectionString);
            Command.Connection = Connection;
        }

        public void CloseConnection(SqlConnection Connection)
        {
            if (Connection.State==ConnectionState.Open)
            {
                Connection.Close();
            }
        }
    }
}